//
//  SwiftHeader.swift
//  FootballDataRecord
//
//  Created by Xx Jiang on 2020/1/7.
//  Copyright © 2020 Xx Jiang. All rights reserved.
//

import Foundation
import UIKit
let KScreenWidth = UIScreen.main.bounds.size.width
let KScreenHeight = UIScreen.main.bounds.size.height


let kStatusBarHeight = UIApplication.shared.statusBarFrame.size.height
let kNavBarHeight = CGFloat(44.0)
let kNavBarAndStatusBarHeight = kStatusBarHeight + kNavBarHeight
let KIsIphoneX = KScreenWidth == 375.0 && KScreenHeight == 812.0 ? true:false
let KTabbarHeight = KIsIphoneX ? (49.0+34.0):49.0
let KBottomSafe = KIsIphoneX ? CGFloat(34.0):CGFloat(0.0)

func DYStringIsEmpty(value: AnyObject?) -> Bool {
      //首先判断是否为nil
      if (nil == value) {
          //对象是nil，直接认为是空串
          return true
      }else{
          //然后是否可以转化为String
          if let myValue  = value as? String{
              //然后对String做判断
              return myValue == "" || myValue == "(null)" || 0 == myValue.count
          }else{
              //字符串都不是，直接认为是空串
              return true
          }
      }
  }

func getImage(path:String) -> UIImage {
      //        let asset = PHAsset.init()
      //
      //        let url = URL.init(fileURLWithPath: path)
      //        let data = NSData.init(contentsOfFile: path)
      //        if data == nil {
      //            return #imageLiteral(resourceName: "defaultUserIcon")
      //        }
      if let image = UIImage.init(contentsOfFile: path) {
          return image
      }else{
          return  #imageLiteral(resourceName: "defaultUserIcon")
      }
  }
  
